import Ability from '@ohos.application.Ability'
import Logger from '../common/logger'
export default class MainAbility extends Ability {
    onCreate(want, launchParam) {
        Logger.info('MainAbility', 'onCreate')
        globalThis.abilityWant = want;
        globalThis.myapplication22Context = this.context;
    }

    onDestroy() {
        Logger.info('MainAbility', 'onDestroy')
    }

    onWindowStageCreate(windowStage) {
        // Main window is created, set main page for this ability
        Logger.info('MainAbility', 'onWindowStageCreate')

        windowStage.setUIContent(this.context, "pages/index", null)
    }

    onWindowStageDestroy() {
        // Main window is destroyed, release UI related resources
        Logger.info('MainAbility', 'onWindowStageDestroy')
    }

    onForeground() {
        // Ability has brought to foreground
        Logger.info('MainAbility', 'onForeground')
    }

    onBackground() {
        // Ability has back to background
        Logger.info('MainAbility', 'onBackground')
    }
};
